package com.qin.springboot;

import cn.hutool.core.util.StrUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Leisure
 * create 2022 2022/9/28 15:08
 **/
@SpringBootApplication
@RestController
public class Start {
    public static void main(String[] args) {
        SpringApplication.run(Start.class,args);
        
    }

    /**
     * who 参数，非必须
     * @param who
     * @return
     */
    @GetMapping("/hello")
    public String sayHello(@RequestParam(required = false,name = "who") String who){
        //判断一个参数是否为空
        if (StrUtil.isBlank(who)){
            who = "World";
        }
        /*加个注释*/
        return StrUtil.format("Hello,{}!",who);
        
    }
}
